import request from '@/util/request'
import store from '@/vuex/store'


export function returnOpinionApi(list) {
    const value = {
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: JSON.stringify(list)
    }
    return request({
        url: 'opinion/returnOpinion.do',
        method: 'post',
        data: value
    })
}

export function returnOpinionStateApi(applyCode) {
    const value = {
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: JSON.stringify(applyCode)
    }
    return request({
        url: 'opinion/returnOpinionState.do',
        method: 'post',
        data: value
    })
}

export function queryOpinionByApplyCodeApi(applyCode) {
    const value = {
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: applyCode
    }
    return request({
        url: 'opinion/queryOpinionByApplyCode.do',
        method: 'post',
        data: value
    })
}

export function getFormOpinoin(applyCode) {
    const value = {
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: applyCode
    }
    return request({
        url: 'opinion/queryFormOpinion.do',
        method: 'post',
        data: value
    })
}